<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%> 
<%@ taglib prefix="d" uri="/WEB-INF/resource.tld" %>

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp"%>
  <%@ include file="/WEB-INF/include/css.jsp"%>
  <title>1V1记录本_${courseRound.student.name}</title>
</head>

  <body style="min-width: 863px;width: 863px;margin: auto;">


  <div class="print">
    
    <div class="basic-data">
      
      <table class="table table-striped table-hover x-table" style="margin-bottom:20px;" border="2">
        <thead>
          <tr>
            <th colspan="9">基础信息</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td class="course-bg-yellow"><strong>年龄</strong></td>
            <td colspan="2">${courseRound.student.user.userFit.age}</td>
            <td class="course-bg-yellow"><strong>身高</strong></td>
            <td colspan="2">${courseRound.student.user.userFit.height}cm</td>
            <td colspan="3" rowspan="2" class="course-bg-yellow"><strong>教练填写具体化部分</strong></td>
          </tr>
          <tr>
            <td colspan="6" class="course-bg-yellow"><strong>教练需要了解您的目标（判断目标合理性及给予适合您的计划）</strong></td>
          </tr>
          <tr>
            <td colspan="6">
              <div style="display: -webkit-box; -webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden; line-height: 1.2;">远期目标：我的目标希望在（<span style="display: inline-block;width: 10rem;">${goal.reachTime}</span>）<br>达成（<span style="display: inline-block;width: 20rem;">${goal.content}</span>）
              </div>
            </td>
            <td colspan="3" rowspan="2" >您六周内的目标数字</td>
          </tr>
          <tr>
            <td colspan="3"></td>
            <td>当前数据</td>
            <td colspan="2">您理想的远期目标数字</td>
          </tr>
          <c:forEach var="bodyDataType" items="${enums['bodyDataType']}" >
            <tr>
              <c:if test="${bodyDataType.ordinal() eq 0}"><td rowspan="8" width="11%"><strong>身体数据目标</strong></td></c:if>
              <td colspan="2">希望${bodyDataType.description}变化<c:if test="${not empty bodyDataType.unit}">(${bodyDataType.unit})</c:if></td>
              <td colspan="1"><fmt:formatNumber value='${targets[bodyDataType.alias].currentValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
              <td colspan="2"><fmt:formatNumber value='${targets[bodyDataType.alias].idealValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
              <td colspan="3"><fmt:formatNumber value='${targets[bodyDataType.alias].coachIdealValue}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
            </tr>
          </c:forEach>
        </tbody>
        
        <thead>
          <tr>
            <th colspan="9" class="course-bg-yellow">学员评估</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td rowspan="6">心肺</td>
            <td colspan="2">静态心率</td>
            <td colspan="3"><c:if test="${not empty basicData.restingHeartRate}">${basicData.restingHeartRate}次/分</c:if></td>
            <td rowspan="14" width="5%">体态</td>
            <td colspan="2">静态正面站姿</td>
          </tr>
          <tr>
            <td colspan="2">最大心率（220-年龄）</td>
            <td colspan="3"><c:if test="${not empty basicData.maxHeartRate}">${basicData.maxHeartRate}次/分</c:if></td>
            <td width="12%">头部</td>
            <td width="20%">${postureJoint.obverseHead.head}</td>
          </tr>
          <tr>
            <td colspan="2" rowspan="2">最佳燃脂心率<br>（最大心率的60%-80%）</td>
            <td colspan="3" rowspan="2"><c:if test="${not empty basicData.burnFatRate}">${basicData.burnFatRate}次/分</c:if></td>
            <td>肩胛骨</td>
            <td>${postureJoint.obverseScapula.scapula}</td>
          </tr>
          <tr>
            <td>骨盆</td>
            <td>${postureJoint.obversePelvis.pelvis}</td>
          </tr>
          <tr>
            <td colspan="2">一分钟波比跳</td>
            <td colspan="3">${empty basicData.standardBobi ? '' : (basicData.standardBobi ? '标准' : '简化')},${basicData.bobi}</td>
            <td>膝关节</td>
            <td>${postureJoint.obverseKneeJoint.kneeJoint}</td>
          </tr>
          <tr>
            <td colspan="2">心血管病史</td>
            <td colspan="3">
              <div style="display: -webkit-box; -webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;line-height: 1.1;">${basicData.cardiovascular}
              </div>
            </td>
            <td colspan="2">静态背面站姿</td>
          </tr>
          <tr>
            <td rowspan="3">基础力量</td>
            <td colspan="2">静蹲</td>
            <td colspan="3">${basicData.staticSquat.staticSquat}</td>
            <td>头部</td>
            <td>${postureJoint.reverseHead.head}</td>
          </tr>
          <tr>
            <td colspan="2">俯卧撑（30s）</td>
            <td colspan="3">${basicData.pushUp.pushUp}</td>
            <td>颈椎</td>
            <td>${postureJoint.reverseCervicalVertebra.cervicalVertebra}</td>
          </tr>
          <tr>
            <td colspan="2">两头起（30s）</td>
            <td colspan="3">${basicData.vUp.vUp}</td>
            <td>髋关节</td>
            <td>${postureJoint.reverseHipJoint.hipJoint}</td>
          </tr>
          <tr>
            <td>运动病史</td>
            <td colspan="5">
              <c:forEach var="disease" items="${basicData.diseaseList}">
                ${disease.description},
              </c:forEach>
            </td>
            <td>膝关节</td>
            <td>${postureJoint.reverseKneeJoint.kneeJoint}</td>
          </tr>
          <tr>
            <td>妈妈学员</td>
            <td colspan="5">腹直肌分离：${basicData.rectusAbdominisIsolation.description}</td>
            <td>足部</td>
            <td>${postureJoint.reverseFoot.foot}</td>
          </tr>
          <tr>
            <td rowspan="10">其他</td>
            <td rowspan="9" colspan="5">${basicData.remark}</td>
            <td colspan="2">自重深蹲</td>
          </tr>
          <tr>
            <td>膝盖伸展方向</td>
            <td>${postureJoint.kneeDirection.kneeDirection}</td>
          </tr>
          <tr>
            <td>上半身于小<br>腿是否平行</td>
            <td><c:if test="${not empty postureJoint.parallel}">${postureJoint.parallel ? '是' : '否'}</c:if></td>
          </tr>
          <tr>
            <td rowspan="7">关节</td>
            <td>胸椎</td>
            <td>${postureJoint.thoracicVertebra.description}</td>
          </tr>
          <tr>
            <td>胸后侧肌群</td>
            <td>${postureJoint.legMuscle.description}</td>
          </tr>
          <tr>
            <td>髋关节</td>
            <td>${postureJoint.hipJoint.description}</td>
          </tr>
          <tr>
            <td>肩关节</td>
            <td>${postureJoint.shoulderJoint.description}</td>
          </tr>
          <tr>
            <td>踝关节</td>
            <td>${postureJoint.ankleJoint.description}</td>
          </tr>
          <tr>
            <td rowspan="2">其他</td>
            <td rowspan="2">
              <div class="tow-line">${postureJoint.jointRemark}</div>
            </td>
          </tr>
        </tbody>
        
        <thead>
          <tr>
            <th colspan="6" style="background: #FEDC32;">学员作息/饮食/运动习惯了解</th>
            <th colspan="3" style="background: #FEDC32;">关节灵活性评估</th>
          </tr>
        </thead>
        <tbody>
            <tr>
              <td colspan="2">
                <div class="one-line" style="text-align: left;">早起时间：${habit.getUpTime}</div>
              </td>
              <td colspan="2">
                <div class="one-line" style="text-align: left;">入睡时间：${habit.sleepTime}</div>
              </td>
              <td colspan="2" width="20%">
                <div class="one-line" style="text-align: left;">应酬频率：${habit.entertainmentFrequency}</div>
              </td>
              <td colspan="3" rowspan="3" style="vertical-align: top;"><div style="text-align: left;"><strong>体态总结：</strong></div>${postureJoint.postureSummary}</td>
            </tr>
            <tr>
              <td></td>
              <td width="12%">早</td>
              <td width="10%">中</td>
              <td width="10%">晚</td>
              <td colspan="2">其他摄入食物</td>
            </tr>
            <tr>
              <td>摄入时间</td>
              <td><div class="one-line">${habit.breakfastTime}</div></td>
              <td><div class="one-line">${habit.lunchTime}</div></td>
              <td><div class="one-line">${habit.dinnerTime}</div></td>
              <td colspan="2">${habit.snackTime}</td>
            </tr>
            <tr>
              <td>摄入具体食物类型及比例</td>
              <td><div class="five-line">${habit.breakfastType}</div></td>
              <td><div class="five-line">${habit.lunchType}</div></td>
              <td><div class="five-line">${habit.dinnerType}</div></td>
              <td colspan="2">${habit.snackType}</td>
              <td colspan="3" style="vertical-align: top;"><div style="text-align: left;"><strong>关节总结：</strong></div>${postureJoint.jointSummary}</td>
            </tr>
            <tr>
              <td>摄入量</td>
              <td><div class="tow-line">${habit.breakfastIntake}</div></td>
              <td><div class="tow-line">${habit.lunchIntake}</div></td>
              <td><div class="tow-line">${habit.dinnerIntake}</div></td>
              <td colspan="2">${habit.snackIntake}</td>
              <td colspan="3" rowspan="3" style="vertical-align: top;"><div style="text-align: left;"><strong>总结：</strong></div>${postureJoint.summary}</td>
            </tr>
            <tr>
              <td>饮水量</td>
              <td colspan="5"><div class="tow-line">${habit.waterIntake}</div></td>
            </tr>
            <tr>
              <td>其他</td>
              <td colspan="5"><div class="tow-line">${habit.remark}</div></td>
            </tr>
          </tbody>
      </table>
      <div class="page-next"></div>
        
      <c:forEach var="i" begin="1" end="${courseRound.fitnessGroup.weeks}" step="1">
        <div class="x-breadcrumb-wrapper" style="margin-top:20px;">
          <div class="x-breadcrumb yellow clearfix">
            <h2>
              <span>周计划（第${i}周）</span>
            </h2>
          </div>
        </div>
          
        <table class="table table-striped table-hover x-table" style="margin-bottom:20px;" border="2">
          <tbody>
            <tr>
              <td colspan="4" class="week-report-bg"><strong>饮食</strong></td>
            </tr>
            <tr>
              <td><strong>早餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].breakfastDescription}</div></td>
            </tr>
            <tr>
              <td><strong>早餐加餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].breakfastSnackDescription}</div></td>
            </tr>
            <tr>
              <td><strong>午餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].lunchDescription}</div></td>
            </tr>
            <tr>
              <td><strong>午餐加餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].lunchSnackDescription}</div></td>
            </tr>
            <tr>
              <td><strong>晚餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].dinnerDescription}</div></td>
            </tr>
            <tr>
              <td><strong>晚餐加餐</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].dinnerSnackDescription}</div></td>
            </tr>
            <tr>
              <td><strong>饮水量</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].waterIntake}</div></td>
            </tr>
            <tr>
              <td><strong>备注</strong></td>
              <td colspan="3"><div class="tow-line">${dietarys[i].remark}</div></td>
            </tr>
            <tr>
              <td colspan="4"  class="week-report-bg"><strong>运动</strong></td>
            </tr>
            <tr>
              <td colspan="4" class="week-report-bg-black" style="color: #fff;"><strong>家庭作业<c:if test="${not empty exercises[i] and not empty exercises[i].homeworkFrequency}">(频率保证一周${exercises[i].homeworkFrequency}次)</c:if></strong></td>
            </tr>
            <tr>
              <td><strong>LISS低强度恒速有氧训练</strong></td>
              <td colspan="3"><div class="four-line">${exercises[i].liss}</div></td>
            </tr>
            <tr>
              <td><strong>HIIT高强度间歇训练</strong></td>
              <td colspan="3"><div class="four-line">${exercises[i].hit}</div></td>
            </tr>
            <tr>
              <td><strong>核心训练</strong></td>
              <td colspan="3"><div class="four-line">${exercises[i].core}</div></td>
            </tr>
            <tr>
              <td><strong>教练备注</strong></td>
              <td colspan="3"><div class="four-line">${exercises[i].remark}</div></td>
            </tr>
            <tr>
              <td colspan="4" style="background: #5A5A5A;color: #FFF;">门店训练<c:if test="${not empty exercises[i] and not empty exercises[i].scheduleFrequency}">(频率保证一周${exercises[i].scheduleFrequency}次)</c:if></td>
            </tr>
            <tr>
              <td width="20%"><strong>上课日期</strong></td>
              <td width="20%"><strong>上课内容</strong></td>
              <td width="40%"><strong>上课评价/总结/记录</strong></td>
              <td width="20%"><strong>上课教练</strong></td>
            </tr>
            <c:forEach var="day" begin="1" end="7" step="1">
              <tr>
                <td>Day&nbsp;&nbsp;${day}</td>
                <td><div class="three-line">
                  <c:forEach var="content" items="${schedules[i][day]['plan'].contentList}" varStatus="status">
                    ${status.index eq 0 ? '' : '+'}${content.description}
                  </c:forEach></div>
                </td>
                <td><div class="three-line">${schedules[i][day]['reality'].comment}</div></td>
                <td><div class="three-line">${schedules[i][day]['reality'].coach.name}</div></td>
              </tr>
            </c:forEach>
          </tbody>
        </table>
        <div class="page-next"></div>
      </c:forEach>
        
        <c:set var="courseAmount" value="${not empty courseRound.attrs['course_amount'] ? courseRound.attrs['course_amount'].value : courseRound.course.hours}"></c:set>
        <c:forEach var="session" begin="1" end="${courseAmount}" step="1">
          <table class="table table-hover table-bordered course-pdf-table">
            <thead>
              <tr>
                <th class="course-bg-yellow">课程${session}</th>
                <th colspan="4" style="background: transparent; "></th>
                <th width="9%" style="background: #fff;">课程日期</th>
                <th width="26%" style="background: #fff;">${courseCoursewares[session]['courseSchedule'].occurDate}</th>
              </tr>
              <tr>
                <th class="course-header-bg" width="10%"></th>
                <th class="course-header-bg" width="26%">动作</th>
                <th class="course-header-bg" width="9%">组数</th>
                <th class="course-header-bg" width="10%">每组次数</th>
                <th class="course-header-bg" width="10%">最大重量</th>
                <th class="course-header-bg" width="9%">计时</th>
                <th class="course-header-bg" width="26%">备注</th>
              </tr>
            </thead>
            <tbody>
              <c:forEach var="courseware" items="${courseCoursewares[session]['coursewares']}" varStatus="status">
                <c:if test="${status.index <= 7}">
                  <tr>
                    <td>${status.index + 1}</td>
                    <td>${courseware.movement.name}</td>
                    <td>${courseware.groupAmount}</td>
                    <td>${courseware.movementNumber}</td>
                    <td>${courseware.maxWeight}</td>
                    <td>${courseware.time}</td>
                    <td>${courseware.remark}</td>
                  </tr>
                </c:if>
              </c:forEach>
              <c:if test="${fn:length(coursewares[session]) < 8}">
                <c:forEach var="i" begin="${fn:length(courseCoursewares[session]['coursewares']) + 1}" end="${8}" step="1">
                  <tr>
                    <td>${i}</td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                    <td></td>
                  </tr>
                </c:forEach>
              </c:if>
            </tbody>
          </table>
          
          <div class="customer-signature">
            <div class="left">上课教练&nbsp;<span class="line" style="text-align: center;">${courseCoursewares[session]['courseSchedule'].coach.name}</span>客户签名&nbsp;<span class="line"></span></div>
            <div class="right">日期&nbsp;<span class="line"></span>年&nbsp;<span class="line"></span>月&nbsp;<span class="line"></span>日&nbsp;<span class="line"></span></div>
          </div>
          <c:if test="${session%3 == 0}">
            <div class="page-next"></div>
          </c:if>
        </c:forEach>
        
        <c:if test="${courseAmount%3 != 0}">
          <div class="page-next"></div>
        </c:if>
        
        <div class="x-breadcrumb-wrapper" style="margin-top:20px;">
          <div class="x-breadcrumb yellow clearfix">
            <h2>
              <span>成果报告</span>
            </h2>
          </div>
        </div>
        
        <table class="table table-striped table-hover x-table" style="margin-bottom:20px;" border="2">
          <thead>
            <tr>
              <th colspan="9" class="week-report-bg">${courseRound.fitnessGroup.weeks}周成果报告</th>
            </tr>
            <tr>
              <th width="10%"></th>
              <th width="15%">体重(KG)</th>
              <th colspan="2" width="15%">体脂(%)</th>
              <th colspan="2" width="15%">胸围(CM)</th>
              <th width="15%">腰围(CM)</th>
              <th width="15%">臀围(CM)</th>
              <th width="15%">备注</th>
            </tr>
          </thead>
          <tbody>
            <c:forEach var="i" begin="0" end="${courseRound.fitnessGroup.weeks}" step="1">
              <tr>
                <td><c:choose><c:when test="${i eq 0}">入营前</c:when><c:otherwise>第${i}周</c:otherwise></c:choose></td>
                <td><fmt:formatNumber value='${bwhRecords[i].weight}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
                <td colspan="2"><fmt:formatNumber value='${bwhRecords[i].bodyFatRate}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
                <td colspan="2"><fmt:formatNumber value='${bwhRecords[i].bust}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
                <td><fmt:formatNumber value='${bwhRecords[i].waist}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
                <td><fmt:formatNumber value='${bwhRecords[i].hips}' minFractionDigits='0' maxFractionDigits='2'></fmt:formatNumber></td>
                <td>${bwhRecords[i].remark}</td>
              </tr>
            </c:forEach>
          </tbody>
          
          <thead>
            <tr>
              <th colspan="7" class="week-report-bg">${courseRound.fitnessGroup.weeks}周的改变如下</th>
              <th colspan="2" class="week-report-bg">接下来的计划</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <td rowspan="3">基础力量</td>
              <td colspan="2" width="20%">静蹲</td>
              <td colspan="2" width="20%">${basicData.staticSquat.staticSquat}</td>
              <td colspan="2" width="20%">${resultReport.staticSquat.staticSquat}</td>
              <td colspan="2"  rowspan="3">${resultReport.basicForcePlan}</td>
            </tr>
            
            <tr>
              <td colspan="2" >俯卧撑（30s）</td>
              <td colspan="2">${basicData.pushUp.pushUp}</td>
              <td colspan="2">${resultReport.pushUp.pushUp}</td>
            </tr>
            
            <tr>
              <td colspan="2" >两头起（30s）</td>
              <td colspan="2">${basicData.vUp.vUp}</td>
              <td colspan="2">${resultReport.vUp.vUp}</td>
            </tr>
            
            <tr>
              <td>心肺测试</td>
              <td colspan="2" >一分钟波比跳</td>
              <td colspan="2">
                <c:if test="${not empty basicData.standardBobi}">${basicData.standardBobi ? '标准，' : '简化，'}</c:if>
                ${basicData.bobi}${empty basicData.bobi ? '' : '个'}
              </td>
              <td colspan="2">
                <c:if test="${not empty resultReport.standardBobi}">${resultReport.standardBobi ? '标准，' : '简化，'}</c:if>
                ${resultReport.bobi}${empty resultReport.bobi ? '' : '个'}
              </td>
              <td colspan="2"><div class="three-line">${resultReport.heartLungPlan}</div></td>
            </tr>
            
            <tr>
              <td colspan="3">其他</td>
              <td colspan="2"><div class="four-line">${basicData.remark}</div></td>
              <td colspan="2"><div class="four-line">${resultReport.remark}</div></td>
              <td colspan="2"><div class="four-line">${resultReport.otherPlan}</div></td>
            </tr>
          </tbody>
          
          <thead>
            <tr>
              <th colspan="9" class="week-report-bg">对本周期的总结</th>
            </tr>
          </thead>
          
          <tbody>
            <tr>
              <td colspan="5" class="pdf-color-yellow">学员</td>
              <td colspan="4" class="pdf-color-yellow">教练</td>
            </tr>
            <tr>
              <td colspan="5"><div class="ten-line">${resultReport.studentSummary}</div></td>
              <td colspan="4"><div class="ten-line">${resultReport.coachSummary}</div></td>
            </tr>
            <tr>
              <td colspan="5" class="pdf-color-yellow">对教练想说的话</td>
              <td colspan="4" class="pdf-color-yellow">对学员想说的话</td>
            </tr>
            <tr>
              <td colspan="5"><div class="ten-line">${resultReport.wordsToCoach}</div></td>
              <td colspan="4"><div class="ten-line">${resultReport.wordsToStudent}</div></td>
            </tr>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</body>

</html>
